package com_djm_2025_06_09.myString.StringBuilderDemo;

import java.util.Scanner;

/**
 *
 * 判断一个字符串是否是回文字符串
 * @author dengjiangming
 * @version 1.0.0
 * @date 2025-06-09
 */
public class StringBuilderDemo6 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String input = sc.nextLine();
        StringBuilder stringBuilder = new StringBuilder(input);

        String reverseInput = stringBuilder.reverse().toString();

        if(input.equals(reverseInput)) {
            System.out.println("是回文字符串");
        }else {
            System.out.println("不是回文字符串");
        }
    }
}
